package com.lenin.omena.client.event;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.lenin.omena.shared.LoginResult;
import com.lenin.omena.shared.DeleteUserResult;
import com.lenin.omena.shared.domain.Site;

public class DeleteUserEvent extends GwtEvent<DeleteUserEventHandler> {

	public static Type<DeleteUserEventHandler> TYPE = new Type<DeleteUserEventHandler>();

	public static HandlerRegistration register(final EventBus eventBus,
			final DeleteUserEventHandler handler) {

		return eventBus.addHandler(DeleteUserEvent.TYPE, handler);

	}

	private DeleteUserResult result;

	public DeleteUserEvent(DeleteUserResult result) {
		this.result = result;
	}

	public DeleteUserResult getResult() {
		return result;
	}

	@Override
	public Type<DeleteUserEventHandler> getAssociatedType() {
		return DeleteUserEvent.TYPE;
	}

	@Override
	protected void dispatch(final DeleteUserEventHandler handler) {
		handler.onDeleteUser(this);
	}

}